From 0a0c0105c427aa8ddebdfbda40ad977fa80c9e21 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Sun, 28 Jan 2007 18:21:22 +0000 Subject: [PATCH] Fix read of invalid integer values. --- win32/gui-2/options.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win32/gui-2/options.pas b/win32/gui-2/options.pas index 1c30b98c5..788eb9723 100644 --- a/win32/gui-2/options.pas +++ b/win32/gui-2/options.pas @@ -767,6 +767,7 @@ var s, key, value: string; r: TRegistry; u: TUpDown; + v: Integer; begin r := TRegistry.Create; try @@ -799,7 +800,12 @@ begin if (value <> '(default)') then begin if HasUpDown(TEdit(o.edit), u) then - u.Position := StrToInt(value) + begin + if (o.def <> nil) then + v := StrToIntDef(o.def, 0) else + v := 0; + u.Position := StrToIntDef(value, v); + end else SetStrProp(o.edit, 'Text', value); end; -- 2.30.2